package com.wing.oauth2.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.EqualsAndHashCode;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

/**
 * @author
 */
@EqualsAndHashCode(callSuper = true)
@JsonSerialize(using = CustomOauthTokenExceptionJsonSerializer.class)
public class CustomOauthTokenException extends OAuth2Exception {


    private int code;

    private String msg;

    public CustomOauthTokenException(String msg, Throwable t) {
        super(msg, t);
    }

    public CustomOauthTokenException(String msg) {
        super(msg);
    }

    public CustomOauthTokenException(int code, String msg) {
        super(msg);
        setCode(code);
        setMessage(msg);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return msg;
    }

    public void setMessage(String msg) {
        this.msg = msg;
    }
}
